package com.rz.htk.warehouse.controller;

import com.rz.core.kit.RespKit;
import com.rz.core.resp.ResultResp;
import com.rz.htk.warehouse.entity.Warehouse;
import com.rz.htk.warehouse.service.IWarehouseService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName WarehouseController
 * @Description 仓储controller
 * @Author maweiyue
 * @Date 2019/4/10 10:37
 */
@RestController
@RequestMapping("/warehouse")
public class WarehouseController {

    @Resource
    private IWarehouseService WarehouseService;

    @PostMapping("/getPage")
    public ResultResp getPage(@RequestBody Warehouse warehouse){
        return RespKit.success(WarehouseService.getPage(warehouse));
    }

    @PostMapping("/saveWarehouse")
    public ResultResp saveWarehouse(@RequestBody Warehouse warehouse){
        return RespKit.success(WarehouseService.saveWarehouse(warehouse));
    }
}
